<template>
    <div>
        <el-form class="register-form" ref="registerForm" :model="registerForm">
            <h3 class="title">RBAC</h3>

            <el-form-item prop="username">
                <el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
                </el-input>
            </el-form-item>
            <el-form-item prop="password">
                <el-input v-model="registerForm.password" type="password" auto-complete="off" placeholder="密码">
                </el-input>
            </el-form-item>

            <el-form-item style="width:100%;">
                <el-button size="medium" type="primary" style="width:100%;" @click="register()">
                    <span>注册</span>
                </el-button>
            </el-form-item>

        </el-form>
    </div>
</template>

<script>

    import {register1} from "../api/system";

    export default {
        name: 'Home',
        data() {
            return {
                registerForm:{
                    username:'',
                    password:'',

                }
            };
        },
        methods: {
            register(){
                register1(this.registerForm.username,this.registerForm.password).then(res=>{
                    this.$message({
                        type:'success',
                        message:"成功"
                    })
                }).catch(err=>{
                    this.$message({
                        type:'error',
                        message:err.message
                    })
                })
            }

        },
        computed: {

        },
        created() {

        }

    }
</script>

<style lang="scss">
    #app > .el-container {
        padding: 0;
        margin: 0;
        height: 100%;
    }

    .el-header {
        background-color: #1F9FFF;
        .el-icon-s-fold, .el-icon-s-unfold {
            font-size: 32px;
            line-height: 60px;
            float: left;
        }


    }

    .el-aside {
        background-color: #FFFFFF;
        text-align: left;
    }

    .el-main {
        background-color: #E9EEF3;
        text-align: center;
        padding: 0;

    }
</style>
